<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="/project/bugweb/Public/Js/jquery-1.8.2.min.js"></script>
<script src="/project/bugweb/Public/Js/jquery-ui.min.js"></script>
<title>无标题文档</title>
<style type="text/css">
body{margin:0; padding:0; min-width:1200px; font-family:'微软雅黑';}
.header{width:100%; height:59px; background-color:#09C; color:#FFF;}
.header ul{list-style:none; margin:0; padding:0; width:100%;}
.header li{width:45%; float:left; background-color:##09C; margin-right:10px; text-align:center;}

.header .usermd{list-style:none; margin:0;}
.header .usermd li{float:right; width:120px; padding:20px 0; margin:0; font-size:14px; border-right:#66C 1px solid; cursor:pointer;}
.header .usermd li:last-child{border-left:#66C 1px solid}
.header .usermd li:hover{background-color:#06C;}

.header .userops{position:relative;}
.header .userops ul{position:absolute; top:59px; left:0; height:0; overflow:hidden; z-index:2; margin:0; background-color:#0CF;}
.header .userops li{float:none;padding:10px 0; height:auto; width:118px; border:0;background-color:#FFF; color:#369; border:#CCC 1px solid; border-top:0;}
.header .userops li:last-child{border-left:#CCC 1px solid;}
.header .userops li:first-child{border:#CCC 1px solid; border-top:0;}
.header .userops li:hover{background-color:#09C; color:#FFF;}
.header .userops .img_dragdown{width:10px; height:10px; margin-left:5px; transform:rotate(0deg);}

.header .userwarn{position:relative;}
.header .userwarn ul{position:absolute; top:59px; width:350px; left:0; height:0; overflow:hidden; z-index:2; margin:0; background-color:#FFF;}
.header .userwarn li{float:none;padding:10px 15px; height:auto; width:100%; border:0;background-color:#FFF; font-size:12px; text-align:left; color:#369; border-bottom:#CCC 1px solid;}
.header .userwarn li:last-child{border-left:#CCC 1px solid;}
.header .userwarn li:first-child{border-bottom:#CCC 1px solid; font-size:15px; font-weight:bold; color:#666; background-color:#CCC;}
.header .userwarn li:first-child:hover{background-color:#CCC; color:#666;}
.header .userwarn li:hover{background-color:#09C; color:#FFF;}
.header .userwarn .img_dragdown{width:10px; height:10px; margin-left:5px; transform:rotate(0deg);}

.mainmenu{width:200px; height:100%; background-color:#333; color:#FFF; overflow:hidden; float:left;}
.mainmenu{}
.mainmenu ul{list-style:none; margin:0; padding:10px 0px;}
.mainmenu li{width:100%; padding:10px 20px; cursor:pointer; font-size:13px;}
.mainmenu li:hover{background-color:#666;}

.maincont{float:left;}
</style>

<style type="text/css">
.mdtitle{height:33px; padding:13px 0 0 10px; font-size:14px; font-weight:bold; border-bottom:#999 1px solid; cursor:default;}
.authops ul{list-style:none; margin:10px 0; padding:0; display:block;}
.authops li{float:left; font-size:13px; padding:7px 20px; border:#999 1px solid; margin:0 10px; border-radius:1px; cursor:pointer; background-color:#DDD;}
.authops li:hover{background-color:#EEE;}

.tablelist{margin:10px 0 0 10px; font-size:14px; cursor:default;}
.tablelist table{border-collapse:collapse; width:90%;}
.tablelist th{text-align:left; padding:5px 10px; background-color:#DDD;}
.tablelist td{padding:5px 10px;}
</style>

</head>

<body>
<div class="header">
	<ul>
    	<li>Logo</li>
        <li class="usermd">
        	<ul>
                <li class="userops" onClick="clickUserOps()">王中艺 <img src="/project/bugweb/Public/Image/saojiao.png" class="img_dragdown">
                	<ul>
                        <li>返回前台</li>
                        <li>退出登录</li>
                        <li>再加一个</li>
                    </ul>
                </li>
                <li class="userwarn" onClick="clickUserWarn()">提醒  <img src="/project/bugweb/Public/Image/saojiao.png" class="img_dragdown">
                	<ul>
                    	<li>站内消息通知</li>
                    	<li>你有一条新消息</li>
                        <li>您有一条新消息</li>
                        <li>你有一条新消息</li>
                    </ul>
                </li>
            </ul>
        </li>
    </ul>
</div>

<div class="mainmenu">
	<ul>
    	<li>用户权限管理</li>
        <li>网站权限添加</li>
    </ul>
</div>

<div class="maincont">
<div class="mdtitle">用户权限管理</div>
<div class="authops">
	<ul>
    	<li>启用</li>
        <li>禁用</li>
        <li>删除</li>
        <li>重置密码</li>
    </ul>
</div>
<div style="clear:both"></div>
<div class="tablelist">
	<table border="1" cellpadding="0" cellspacing="0">
    <tr><th><input type="checkbox" id="allselect" ></th>
    	<th>UID</th><th>昵称</th><th>账号</th><th>登陆次数</th><th>最后登录时间</th><th>最后登录IP</th><th>状态</th><th>操作</th></tr>
    <?php if(is_array($userlist)): foreach($userlist as $key=>$user): ?><tr><td><input type="checkbox" value="<?php echo ($user["userid"]); ?>" name="users[]"></td>
    	<td><?php echo ($user["userid"]); ?></td><td><?php echo ($user["nickname"]); ?></td><td><?php echo ($user["username"]); ?></td><td><?php echo ($user["logincount"]); ?></td>
        <td><?php echo (strtotime($user["lastdate"])); ?></td><td><?php echo ($user["lastip"]); ?></td><td><?php echo ($user["valid"]); ?></td><td>
        	<a href="index?func=changeValid&userid=<?php echo ($user["userid"]); ?>&valid=<?php echo ($user["valid"]); ?>"><?php if(($user["valid"] == 1)): ?>禁用<?php else: ?>启用<?php endif; ?></a> 
            <a href="index?func=changeGroup&userid=<?php echo ($user["userid"]); ?>">授权</a> 
            <a href="index?func=deleteUser&userid=<?php echo ($user["userid"]); ?>">删除</a> 
            <a href="index?func=recoverPwd&userid=<?php echo ($user["userid"]); ?>">重置密码</a></td></tr><?php endforeach; endif; ?><!--
    <tr><td><input type="checkbox" name="users[]"></td>
    	<td>1</td><td>王中艺</td><td>wangzhongyi@iruiyou.com</td><td>1</td><td>1991-01-01</td><td>0.0.0.0</td><td>正常</td><td>禁用 授权 删除 重置密码</td></tr>
    <tr><td><input type="checkbox" name="users[]"></td>
    	<td>1</td><td>王中艺</td><td>wangzhongyi@iruiyou.com</td><td>1</td><td>1991-01-01</td><td>0.0.0.0</td><td>正常</td><td>禁用 授权 删除 重置密码</td></tr>
    <tr><td><input type="checkbox" name="users[]"></td>
    	<td>1</td><td>王中艺</td><td>wangzhongyi@iruiyou.com</td><td>1</td><td>1991-01-01</td><td>0.0.0.0</td><td>正常</td><td>禁用 授权 删除 重置密码</td></tr>-->
    </table>
</div>
</div>
</body>

<script language="javascript">
$(".tablelist table tr:odd").css("background-color","rgba(255,255,255,1)");
$(".tablelist table tr:even").css("background-color","rgba(250,250,250,1)");

$("#allselect").click(function(){
	if($(this).attr("checked") == "checked"){
		$("[name = 'users[]']").attr("checked","checked");
	}else{
		$("[name = 'users[]']").removeAttr("checked");
	}
});
</script>

<script language="javascript">
var screenWidth, screenHeight, userOpsLiCount, userWarnLiCount, 
	userOpsStatus, userWarnStatus;
toRun();
//初始化数据
function toRun(){
	screenWidth	= $(window).width();
	screenHeight	= $(window).height();
	$("body").css("min-height",screenHeight+'px');
	$(".mainmenu").css("height",screenHeight-$(".header").height()+'px');
	$(".maincont").css("width", $(".header").width()-$(".mainmenu").width()-150+'px');
}
//特效设计
function clickUserOps(){
	userOpsLiCount	= $(".userops ul").children("li").length;
	
	if($(".userops ul").css("height") == "0px"){
		userOpsStatus	= 1;
		if(userWarnStatus == 1 ) clickUserWarn();
		$(".userops").css("background-color",$(".userops:hover").css("background-color"));
		$(".userops ul").animate({height:userOpsLiCount*40},100);
		$(".userops .img_dragdown").css("-webkit-transform","rotate(180deg)");
	}else{
		userOpsStatus	= 0;
		$(".userops").css("background-color","");
		$(".userops ul").animate({height:0},100);
		$(".userops .img_dragdown").css("-webkit-transform","rotate(0deg)");
	}
}

function clickUserWarn(){
	userWarnLiCount	= $(".userwarn ul").children("li").length;
	
	if($(".userwarn ul").css("height") == "0px"){
		userWarnStatus	= 1;
		if(userOpsStatus == 1) clickUserOps();
		$(".userwarn").css("background-color",$(".userwarn:hover").css("background-color"));
		$(".userwarn ul").animate({height:userWarnLiCount*37},100).css("border","#CCC 1px solid");
		$(".userwarn .img_dragdown").css("-webkit-transform","rotate(180deg)");
	}else{
		userWarnStatus	= 0;
		$(".userwarn").css("background-color","");
		$(".userwarn ul").animate({height:0},100).css("border","#CCC 0px solid");
		$(".userwarn .img_dragdown").css("-webkit-transform","rotate(0deg)");
	}
}

</script>
</html>